home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swaga_c.zip / ANSI.SWG / 0021_ANSI in a window.pas < prev    next >
Pascal/Delphi Source File  |  1993-11-02  |  1KB  |  38 lines

  1. {
  2. MAYNARD PHILBROOK
  3.  
  4. > I am having troubles displaying an ANSI codes from a Text File. I can do it
  5. > fine With the full screen, but I have trouble trying to do it Within a
  6. > Window.  if I use the usual ASSIGN (Con, ''); WriteLn (Con, AnsiText);
  7. > IT works fine, but not Within a Window.  The Con TextFile seems to ignore
  8. > Window limitations, and I can understand that.  My question is how to get
  9. > around it?  Do I have to use an ANSI Unit which converts ANSI codes to
  10. > TP color codes?  I am looking For such a Unit, but is that the only
  11.  
  12.  TP Windows is Directly Writeln to the Screen memory, You can how ever
  13.  Redirect Dos to a TP Window.
  14. }
  15.  
  16. {$M 1024, 0, 1000}
  17.  
  18. Uses
  19.   Dos, Crt;
  20.  
  21. Var
  22.   Old_Vect : Pointer;
  23.  
  24. Procedure Redirect_OutPut(Character : Char); Interrupt;
  25. begin
  26.   Write(Character);
  27. end;
  28.  
  29. begin
  30.  GetIntVec($29, Old_Vect);        { Save Old Vector }
  31.  SetIntVec($29, @Redirect_OutPut);
  32.  Window(10, 3, 70, 20);
  33.  Exec(' MainProgram ','');        { all output using WriteLn(Con,'????') }
  34.  SetIntVec($29, Old_Vect);      { to this Window }
  35.  Halt(DosError);
  36. end;
  37.  
  38.